package Common 
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.*;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import flash.net.URLRequest;
	
	public class BitmapSprite extends Sprite {
		private var url:String = "1.png";
		
		public function BitmapSprite() {
			configureAssets();
		}
		
		private function configureAssets():void {
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
			loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
			
			var request:URLRequest = new URLRequest(url);
			loader.load(request);
			addChild(loader);
		}
		
		private function completeHandler(event:Event):void {

		}
		
		private function ioErrorHandler(event:IOErrorEvent):void {
			trace(event.text + " Unable to load image: " + url);
		}
	}
}